import { isShowPass, JZLZ_STATE, XQBZ_STATE, KCBSH_STATE, JHXD_STATE, SHZ_STATE, ZRBGH_STATE, XQZF_STATE } from '../common/Format';
import moment from 'moment';
import Cls from 'classnames';
import { getTenantID, tooltipLength } from '@/utils';
import MyIcon from '@/components/MyIcon';
import pageStyles from '@/common/pageLayout.less';
import { DeleteOutlined, PlusCircleOutlined } from '@ant-design/icons';
import { Tooltip, InputNumber, DatePicker, Button, Switch, Input } from 'antd';
import { ColumnsRenderFun, formatDecimal, BZZ_CHECKSTATE, getColorTextDoms, SHTH_CHECKSTATE } from '../../Acommon';
import { ILoadMapTypeAll } from '@/common';

// 归口部门字段
const centralizedFields = ['needProofFlag', 'needProofURL', 'needImportFlag', 'needImportURL', 'needSingleFlag', 'needSingleURL'];

const TimePicker: any = DatePicker;

/**
 * @getNeedTableColumns
 * @description 添加编辑需求表格信息展示和操作
 */
const getNeedTableColumns = (operate: any): Record<string, any>[] => {
  // 参数解构
  const { onProjectChange, openMateridal, onRemove, needInfo, setIsShowDetail, onEditTable, form, nodesFlowListMemo, isView, isEngIneer, curRes } = operate;

  const iscom =
    (typeof needInfo?.state == 'undefined' ||
      needInfo?.state == XQBZ_STATE() ||
      (needInfo?.state == SHZ_STATE() && needInfo?.checkState == SHTH_CHECKSTATE())) &&
    !isView;

  // 是否展示操作按钮 true = 展示 || false = 不展示
  const isShowOperation = iscom;

  // 是否展示上传附件字段 true = 展示 || false = 不展示
  const isShowUpload =
    needInfo?.state &&
    (needInfo?.state == JZLZ_STATE() ||
      needInfo?.state == ZRBGH_STATE() ||
      needInfo?.state == JHXD_STATE() ||
      needInfo?.state == XQZF_STATE() ||
      needInfo?.state == KCBSH_STATE());

  // 再集中论证的时候是否可以切换switch和上传文件 true==可以操作  false==不可以操作
  const isOpenUpLoad = needInfo?.state && needInfo?.state == JZLZ_STATE() && needInfo?.checkState == BZZ_CHECKSTATE() && nodesFlowListMemo;

  let columsArr: Record<string, any>[] = [
    {
      title: '序号',
      dataIndex: 'index',
      key: 'index',
      width: 60,
      align: 'center',
      fixed: 'left',
      render: (_: string, __: Record<string, any>, index: string) => index + 1,
    },
    // {
    //   title: (
    //     <>
    //       {iscom ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
    //       标的类别
    //     </>
    //   ),
    //   dataIndex: 'supplyTypeName',
    //   key: 'supplyTypeName',
    //   width: 135,
    //   fixed: 'left',
    //   render: (text: string, record: Record<string, any>) => {
    //     if (iscom && !isEngIneer && (!needInfo?.id || needInfo?.state == XQBZ_STATE())) {
    //       return (
    //         <div>
    //           <Select
    //             placeholder="请选择"
    //             style={{ width: '100%' }}
    //             onSelect={(val) => onEditTable({ value: val, key: 'supplyType', type: 'Select', record })}
    //             value={record?.supplyType == `${getTenantID()}${ILoadMapTypeAll.PURCHASE_CATEGORY}1000` ? undefined : record?.supplyType}
    //           >
    //             <Select.Option
    //               key={`${getTenantID()}${ILoadMapTypeAll.PURCHASE_CATEGORY}1003`}
    //               value={`${getTenantID()}${ILoadMapTypeAll.PURCHASE_CATEGORY}1003`}
    //             >
    //               材料类
    //             </Select.Option>
    //             <Select.Option
    //               key={`${getTenantID()}${ILoadMapTypeAll.PURCHASE_CATEGORY}1004`}
    //               value={`${getTenantID()}${ILoadMapTypeAll.PURCHASE_CATEGORY}1004`}
    //             >
    //               资产类
    //             </Select.Option>
    //           </Select>
    //         </div>
    //       );
    //     }
    //     return DictionaryRenderFun({ text });
    //   },
    // },
    {
      title: '标的名称',
      dataIndex: 'fullName',
      key: 'fullName',
      fixed: 'left',
      width: 165,
      render: (text: string, record: Record<string, any>) => {
        if (isEngIneer) return ColumnsRenderFun({ text });
        if (
          (record?.supplyType == `${getTenantID()}${ILoadMapTypeAll.PURCHASE_CATEGORY}1003` ||
            record?.supplyType == `${getTenantID()}${ILoadMapTypeAll.PURCHASE_CATEGORY}1004` ||
            record?.supplyType == `${getTenantID()}${ILoadMapTypeAll.PURCHASE_CATEGORY}1000`) &&
          curRes?.['/materialController/details/{params}']
        ) {
          return (
            <a onClick={() => setIsShowDetail(record?.materialID || record?.materialIDS)} style={{ color: '100%' }}>
              <Tooltip title={tooltipLength(text, 50)}>
                <span className={pageStyles['over-flow-hidden']}>{text || '--'}</span>
              </Tooltip>
            </a>
          );
        } else {
          return ColumnsRenderFun({ text });
        }
      },
    },
    {
      title: '规格要求（参数）',
      dataIndex: 'needParams', // needParams[需求物料表中]  specInfo[物料表中]
      key: 'needParams',
      width: 180,
      render: (text: string, record: Record<string, any>) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },

    {
      title: (
        <>
          {iscom ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
          预估单价（元）
        </>
      ),
      dataIndex: 'expectPrice',
      key: 'expectPrice',
      width: 170,
      render: (text: number, record: Record<string, any>) => {
        if (iscom) {
          return (
            <InputNumber
              bordered={false}
              value={text}
              onChange={(value: any) => onEditTable({ value, key: 'expectPrice', type: 'InputNumber', record })}
              precision={2}
              defaultValue={undefined}
              min={0}
              onBlur={(val) => {
                /** 如果val是空串，则给0.00字符串 */
                if (val?.target?.value === '') {
                  onEditTable({ value: '0.00', key: 'expectPrice', type: 'InputNumber', record });
                }
              }}
            />
          );
        } else {
          return <span>{formatDecimal(text) || '--'}</span>;
        }
      },
    },
    {
      title: (
        <>
          {iscom ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
          需求数量（单位）
        </>
      ),
      dataIndex: 'expectNum',
      key: 'expectNum',
      width: 190,
      render: (text: number | string, record: Record<string, any>) => {
        if (iscom) {
          return (
            <div
              style={{
                display: 'flex',
                justifyContent: 'center',
                alignItems: 'center',
              }}
            >
              <InputNumber
                bordered={false}
                value={text}
                onChange={(value: any) =>
                  onEditTable({
                    value,
                    key: 'expectNum',
                    type: 'InputNumber',
                    record,
                  })
                }
                min={0.01}
              />
              {/*单位*/}
              {getColorTextDoms(record?.unitBusinessName)}
            </div>
          );
        } else {
          return (
            <div style={{ display: 'flex' }} className={pageStyles['over-flow-hidden']}>
              <div style={{ marginRight: '8px' }}>{text || '--'}</div>
              {getColorTextDoms(record?.unitBusinessName)}
            </div>
          );
        }
      },
    },
    {
      title: '预估总价（元）',
      dataIndex: 'expectSum',
      key: 'expectSum',
      width: 200,
      render: (text: string | number) => {
        return <div className={'custom-td'}>{typeof text != null || typeof text != undefined ? text : 0.0}</div>;
      },
      filters: [
        {
          text: '>50万元',
          value: 500000,
        },
      ],
      onFilter: (value: number, record: Record<string, any>) => {
        let recordAllPrice: number = Number(record?.expectSum);
        return value <= recordAllPrice;
      },
    },
    {
      title: (
        <>
          {iscom ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
          项目编号
        </>
      ),
      dataIndex: 'projectCode',
      key: 'projectCode',
      width: 200,
      render: (text, record) => {
        if (iscom) {
          return <Input bordered={false} value={text} placeholder="请选择" onClick={() => onProjectChange(record)} />;
        } else {
          return (
            <Tooltip title={text}>
              <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
            </Tooltip>
          );
        }
      },
    },
    {
      title: (
        <>
          {iscom ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
          项目名称
        </>
      ),
      dataIndex: 'projectName',
      key: 'projectName',
      width: 200,
      render: (text, record) => {
        if (iscom) {
          return <Input bordered={false} value={text} placeholder="请选择" onClick={() => onProjectChange(record)} />;
        } else {
          return (
            <Tooltip title={text}>
              <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
            </Tooltip>
          );
        }
      },
    },
    {
      title: (
        <>
          {iscom ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
          项目金额（元）
        </>
      ),
      dataIndex: 'projectSum',
      key: 'projectSum',
      width: 200,
      render: (text, record) => {
        if (iscom) {
          return <Input bordered={false} value={text} placeholder="请选择" onClick={() => onProjectChange(record)} />;
        } else {
          return <div className={pageStyles['over-flow-hidden']}>{formatDecimal(text) || '--'}</div>;
        }
      },
    },
    {
      title: (
        <>
          {iscom ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
          标包号
        </>
      ),
      dataIndex: 'packCode',
      key: 'packCode',
      width: 200,
      render: (text: string, record) => {
        if (iscom) {
          return (
            <InputNumber
              bordered={false}
              value={text}
              onChange={(value: any) =>
                onEditTable({
                  value,
                  key: 'packCode',
                  type: 'InputNumber',
                  record,
                })
              }
              min={0.01}
            />
            // <Input
            //   bordered={false}
            //   value={text}
            //   placeholder="请输入"
            //   onChange={(e: any) => {
            //     onEditTable({
            //       value: e?.target?.value || '',
            //       key: 'packCode',
            //       type: 'Input',
            //       record,
            //     });
            //   }}
            // />
          );
        } else {
          return (
            <Tooltip title={text}>
              <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
            </Tooltip>
          );
        }
      },
    },
    {
      title: (
        <>
          {iscom ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
          是否平台
        </>
      ),
      dataIndex: 'isPlatform',
      key: 'isPlatform',
      width: 150,
      render: (text: string, record) => {
        if (iscom) {
          return (
            <Switch
              onChange={(checked: boolean) => {
                onEditTable({ value: checked, key: 'isPlatform', type: 'switch', record });
              }}
              checkedChildren="是"
              unCheckedChildren="否"
              defaultChecked={Boolean(text)}
            />
          );
        }
        return isShowPass(text);
      },
    },
    {
      title: (
        <>
          {iscom ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
          是否进口
        </>
      ),
      dataIndex: 'importFlag',
      key: 'importFlag',
      width: 120,
      render: (text: number, record: Record<string, any>) => {
        if (iscom) {
          return (
            <Switch
              onChange={(checked: boolean) => {
                onEditTable({ value: checked, key: 'importFlag', type: 'switch', record });
              }}
              checkedChildren="是"
              unCheckedChildren="否"
              defaultChecked={Boolean(text)}
            />
          );
        }
        return isShowPass(text);
      },
    },
    {
      title: (
        <>
          {iscom ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
          是否单一来源
        </>
      ),
      dataIndex: 'singleFlag',
      key: 'singleFlag',
      width: 170,
      render: (text: number, record: Record<string, any>) => {
        if (iscom) {
          return (
            <Switch
              onChange={(checked: boolean) => {
                onEditTable({ value: checked, key: 'singleFlag', type: 'switch', record });
              }}
              checkedChildren="是"
              unCheckedChildren="否"
              defaultChecked={Boolean(text)}
            />
          );
        }
        return isShowPass(text);
      },
    },
    {
      title: (
        <>
          {iscom ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
          计划采购时间
        </>
      ),
      dataIndex: 'expectTime',
      key: 'expectTime',
      width: 180,
      render: (text: number, record: Record<string, any>) => {
        if (iscom) {
          return (
            <TimePicker
              defaultValue={text ? moment(text) : null}
              bordered={false}
              picker="month"
              defaultPickerValue={[moment().add(1, 'month').startOf('month'), moment().add(1, 'month').startOf('month').clone().endOf('month')]}
              disabledDate={(current: any) => {
                // 设置某一个时间（例如：2023年7月15日）当前月也可以选择
                const afterDate = moment(new Date(), 'YYYY-MM-DD').add(0, 'month');
                // 返回 true 表示禁用，false 表示可选
                return current && current < afterDate;
              }}
              onChange={(checked: boolean) => {
                onEditTable({ value: checked, key: 'expectTime', type: 'TimePicker', record });
              }}
            />
          );
        } else {
          return text ? moment(text)?.format('YYYY-MM') : '--';
        }
      },
    },
    // {
    //   title: (
    //     <>
    //       {iscom ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
    //       技术规范
    //     </>
    //   ),
    //   dataIndex: 'skillNormURL',
    //   key: 'skillNormURL',
    //   width: 250,
    //   render: (_, record) => {
    //     if (iscom) {
    //       return (
    //         <>
    //           <UploadFormCommon
    //             form={form}
    //             fileFormName={'skillNormURL'}
    //             spanCol={24}
    //             inRowProportion={24}
    //             spliceStr={8}
    //             name={'attachFile'}
    //             required={true}
    //             accept={'.doc|.docx|.pdf'}
    //             url={'/purchaseNeedController/uploadFile'}
    //             downloadUrl={'/purchaseNeedController/downloadFile'}
    //             fileFormDelName={'delFile'}
    //             defaultFiles={record && record?.id && record?.['skillNormURL'] != '' ? record?.['skillNormURL'] : null}
    //             maxFile={1}
    //             isShowUploadBtn={true}
    //             hintTitle={'且只能上传 1 个！'}
    //             fieldBusiPath={'purchase/need'}
    //             uploadSuccessCallback={(attachPaths) => onEditTable({ value: attachPaths, key: 'skillNormURL', type: 'UploadFormCommon', record })}
    //             delFunc={() => onEditTable({ value: null, key: 'skillNormURL', type: 'UploadFormCommon', record })}
    //           >
    //             上传
    //           </UploadFormCommon>
    //         </>
    //       );
    //     } else {
    //       return renderFileFunc({
    //         record,
    //         fileName: 'skillNormURL',
    //         downloadAddress: '/purchaseNeedController/downloadFile',
    //         returnStr: '/',
    //       });
    //     }
    //   },
    // },
    // {
    //   title: (
    //     <>
    //       {iscom ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
    //       调研报告
    //     </>
    //   ),
    //   dataIndex: 'researchReportURL',
    //   key: 'researchReportURL',
    //   width: 250,
    //   render: (_, record) => {
    //     if (iscom) {
    //       return (
    //         <>
    //           <UploadFormCommon
    //             form={form}
    //             fileFormName={'researchReportURL'}
    //             spanCol={24}
    //             inRowProportion={24}
    //             spliceStr={8}
    //             name={'attachFile'}
    //             required={true}
    //             accept={'.doc|.docx|.pdf'}
    //             url={'/purchaseNeedController/uploadFile'}
    //             downloadUrl={'/purchaseNeedController/downloadFile'}
    //             fileFormDelName={'delFile'}
    //             defaultFiles={record && record?.id && record?.['researchReportURL'] != '' ? record?.['researchReportURL'] : null}
    //             maxFile={1}
    //             isShowUploadBtn={true}
    //             hintTitle={'且只能上传 1 个！'}
    //             fieldBusiPath={'purchase/need'}
    //             uploadSuccessCallback={(attachPaths) => onEditTable({ value: attachPaths, key: 'researchReportURL', type: 'UploadFormCommon', record })}
    //             delFunc={() => onEditTable({ value: null, key: 'researchReportURL', type: 'UploadFormCommon', record })}
    //           >
    //             上传
    //           </UploadFormCommon>
    //         </>
    //       );
    //     } else {
    //       return renderFileFunc({
    //         record,
    //         fileName: 'researchReportURL',
    //         downloadAddress: '/purchaseNeedController/downloadFile',
    //         returnStr: '/',
    //       });
    //     }
    //   },
    // },

    // 2024/11/22需求沟通 去除  ============================== START ==============================
    // {
    //   title: (
    //     <>
    //       {needInfo?.state == JZLZ_STATE() ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
    //       是否通过需求论证
    //     </>
    //   ),
    //   dataIndex: 'needProofFlag',
    //   key: 'needProofFlag',
    //   width: 190,
    //   render: (text: string | number, record: Record<string, any>) => {
    //     if (isOpenUpLoad) {
    //       return (
    //         <Switch
    //           onChange={(checked: boolean) => {
    //             if (Number(record?.expectSum) < 500000) {
    //               onEditTable({ value: checked, key: 'needProofFlag', type: 'switch', record });
    //             } else {
    //               message?.warn('单项金额超过50万元需要填写需求论证意见！');
    //             }
    //           }}
    //           checkedChildren="是"
    //           unCheckedChildren="否"
    //           checked={text == 1 ? true : text == 0 ? false : false}
    //         />
    //       );
    //     } else {
    //       if (!(Number(record?.expectSum) < 500000)) {
    //         return isShowPass(record?.needProofFlag);
    //       } else {
    //         return '/';
    //       }
    //     }
    //   },
    // },
    // {
    //   title: (
    //     <>
    //       {needInfo?.state == JZLZ_STATE() ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
    //       需求论证意见
    //     </>
    //   ),
    //   dataIndex: 'needProofURL',
    //   key: 'needProofURL',
    //   width: 230,
    //   render: (text: string, record: Record<string, any>) => {
    //     return isShowUploadBtn({
    //       record,
    //       needInfo,
    //       form,
    //       onEditTable,
    //       fileName: 'needProofURL',
    //       judgeName: 'needProofFlag',
    //       nodesFlowListMemo,
    //     });
    //   },
    // },
    // {
    //   title: (
    //     <>
    //       {needInfo?.state == JZLZ_STATE() ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
    //       是否通过进口专业人员论证
    //     </>
    //   ),
    //   dataIndex: 'needImportFlag',
    //   key: 'needImportFlag',
    //   width: 260,
    //   render: (text: number | string, record: Record<string, any>) => {
    //     if (isOpenUpLoad) {
    //       if (record?.importFlag == 1) {
    //         return (
    //           <Switch
    //             onChange={(checked: boolean) => onEditTable({ value: checked, key: 'needImportFlag', type: 'switch', record })}
    //             checkedChildren="是"
    //             unCheckedChildren="否"
    //             checked={text == 1 ? true : text == 0 ? false : false}
    //           />
    //         );
    //       } else {
    //         return '/';
    //       }
    //     } else {
    //       if (record?.importFlag == 1) {
    //         return isShowPass(record?.needImportFlag);
    //       } else {
    //         return '/';
    //       }
    //     }
    //   },
    // },
    // {
    //   title: (
    //     <>
    //       {needInfo?.state == JZLZ_STATE() ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
    //       进口专业人员论证意见
    //     </>
    //   ),
    //   dataIndex: 'needImportURL',
    //   key: 'needImportURL',
    //   width: 230,
    //   render: (text: string, record: Record<string, any>) => {
    //     return isShowUploadBtn({
    //       record,
    //       needInfo,
    //       form,
    //       onEditTable,
    //       fileName: 'needImportURL',
    //       judgeName: 'needImportFlag',
    //       nodesFlowListMemo,
    //     });
    //   },
    // },
    // {
    //   title: (
    //     <>
    //       {needInfo?.state == JZLZ_STATE() ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
    //       是否通过单一来源论证
    //     </>
    //   ),
    //   dataIndex: 'needSingleFlag',
    //   key: 'needSingleFlag',
    //   width: 230,
    //   render: (text: number | string, record: Record<string, any>) => {
    //     if (isOpenUpLoad) {
    //       if (record?.singleFlag == 1) {
    //         return (
    //           <Switch
    //             onChange={(checked: boolean) => onEditTable({ value: checked, key: 'needSingleFlag', type: 'switch', record })}
    //             checkedChildren="是"
    //             unCheckedChildren="否"
    //             checked={text == 1 ? true : text == 0 ? false : false}
    //           />
    //         );
    //       } else {
    //         return '/';
    //       }
    //     } else {
    //       if (record?.singleFlag == 1) {
    //         return isShowPass(record?.needSingleFlag);
    //       } else {
    //         return '/';
    //       }
    //     }
    //   },
    // },
    // {
    //   title: (
    //     <>
    //       {needInfo?.state == JZLZ_STATE() ? <MyIcon type="icon-edit1" style={{ marginRight: '.5rem' }} /> : null}
    //       单一来源论证意见
    //     </>
    //   ),
    //   dataIndex: 'needSingleURL',
    //   key: 'needSingleURL',
    //   width: 230,
    //   render: (text: string, record: Record<string, any>) => {
    //     return isShowUploadBtn({
    //       record,
    //       needInfo,
    //       form,
    //       onEditTable,
    //       fileName: 'needSingleURL',
    //       judgeName: 'needSingleFlag',
    //       nodesFlowListMemo,
    //     });
    //   },
    // },
    // 2024/11/22需求沟通 去除  ============================== END ==============================

    {
      title: (
        <Tooltip title={isEngIneer ? '新增' : '选择'}>
          <Button type={'link'} size={'small'} className="manageBtntTxtStyle" icon={<PlusCircleOutlined />} onClick={openMateridal}>
            {isEngIneer ? '新增' : '选择'}
          </Button>
        </Tooltip>
      ),
      width: 120,
      dataIndex: 'operation',
      key: 'operation',
      align: 'center',
      fixed: 'right',
      render: (_: string, record: Record<string, any>) => {
        return (
          <Tooltip title={'删除'}>
            <Button
              type={'link'}
              size={'small'}
              className={Cls('manageBtntTxtStyle', 'manageColorRedBtn')}
              danger
              icon={<DeleteOutlined />}
              onClick={() => {
                onRemove(record);
              }}
            >
              删除
            </Button>
          </Tooltip>
        );
      },
    },
  ].filter((item) => {
    if (isShowUpload) {
      // =================展示上传附件列###
      if (isShowOperation) {
        // =================展示操作列###
        /**
         * 都展示
         * */
        return item;
      } else {
        // =================不展示操作列###
        /**
         * 过滤操作列 展示上传列
         * */
        return item.dataIndex != 'operation';
      }
    } else {
      // =================不展示上传附件列###
      if (isShowOperation) {
        // =================展示操作列###
        /**
         * 过滤上传列 展示操作列
         * */
        return !centralizedFields.includes(item.dataIndex);
      } else {
        // =================不展示操作列###
        /**
         * 都不展示
         * */
        return !centralizedFields.includes(item.dataIndex) && item.dataIndex != 'operation';
      }
    }
  });

  // if (needInfo?.state == JHXD_STATE()) {
  //   columsArr.splice(7, 0, {
  //     title: '审核状态',
  //     dataIndex: 'checkState',
  //     key: 'checkState',
  //     width: 120,
  //     visible: true,
  //     render: (text: number) => {
  //       return (
  //         <Tooltip>
  //           <span className={pageStyles['over-flow-hidden']}>
  //             {!text ? (
  //               <span className={pageStyles['over-flow-hidden']} style={{ color: '#1677ff' }}>
  //                 待审核
  //               </span>
  //             ) : text == 1 ? (
  //               <span className={pageStyles['over-flow-hidden']} style={{ color: '#1e9392' }}>
  //                 同意
  //               </span>
  //             ) : text == 2 ? (
  //               <span className={pageStyles['over-flow-hidden']} style={{ color: 'red' }}>
  //                 不同意
  //               </span>
  //             ) : (
  //               '--'
  //             )}
  //           </span>
  //         </Tooltip>
  //       );
  //     },
  //   });
  // }

  return columsArr;
};

export { getNeedTableColumns };
